# -*- mode: snippet -*-
# name: ggplot geom_text with math/equation
# key: ggplot2.geom_text.math
# key: geom_text.math@ggplot2
# contributor: Shuguang Sun
# --
eq <- substitute(italic(y) == a + b %.% italic(x)~","~italic(R)^2~"="~r2~","~italic(P)~"="~p)
geom_text(aes(x = 4, y = 50, label = as.character(as.expression(eq))), parse = TRUE)